package com.ruoyi.common.enums;

/**
 * 判定结果枚举
 * @author zhangwenqiang
 */
public enum ResultEums {
    // 不合格
    NOT_QUALIFIED(0,"不合格"),
    // 合格
    QUALIFIED(1,"合格");

    private final int value;

    private final String description;

    ResultEums(int value,String description) {
        this.value = value;
        this.description = description;
    }


    /**
     * 获取值
     * @return
     */
    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据值获取枚举项
     * @param value
     * @return
     */
    public static ResultEums fromValue(int value) {
        for (ResultEums ResultEums : ResultEums.values()) {
            if (ResultEums.getValue() == value) {
                return ResultEums;
            }
        }
        throw new IllegalArgumentException("Unexpected value: " + value);
    }
}
